const express = require("express");
const router = express.Router();
const userinfo = require("./userinfo/userinfo");
const expressJoi = require("@escook/express-joi");
const { update_password_schema } = require("../schema/user");
const { updata_userinfo_schema } = require("../schema/userinfo");
const { update_avatar_schema } = require("../schema/update_avatar");
router.get("/userinfo", userinfo.getUserinfo);
router.post(
  "/userinfo",
  expressJoi(updata_userinfo_schema),
  userinfo.updateUserInfo
);
router.post(
  "/updatepwd",
  expressJoi(update_password_schema),
  userinfo.updatePassword
);
router.post(
  "/update/avatar",
  expressJoi(update_avatar_schema),
  userinfo.updateAvartar
);
module.exports = router;
